var row_size;
var column_size;
$().ready(function load(){startHtml();
	eventtimer();
var e=$("#isShopComment").val();
if(null!=e){$("#shopEvaluateDiv").click()}if($("#size_table").size()!=0){row_size=$("#size_table tr").size();
column_size=$("#size_table tr")[0].cells.length;
if(row_size>1&&column_size>1){if(column_size>=row_size){for(g=1;
	g<=column_size;
g++){var n=0;
	$("#size_table tr td:nth-child("+g+")").each(function(){if($(this).text()==""||$(this).text()==null){n++}});
if(n==$("#size_table tr td:nth-child("+g+")").size()){$("#size_table tr td:nth-child("+g+")").hide();
$("#size_table tr th").eq(g-1).hide()}}}else{for(g=1;
	g<=row_size;
g++){var n=0;
	$("#size_table tr td:nth-child("+g+")").each(function(){if($(this).text()==""||$(this).text()==null){n++}});
if(n==$("#size_table tr td:nth-child("+g+")").size()){$("#size_table tr td:nth-child("+g+")").hide();
$("#size_table tr th").eq(g-1).hide()}}}}if(row_size>1&&column_size>1){if(column_size>=row_size){for(g=1;
	g<=column_size;
g++){$("#size_table tr th").each(function(){if($(this).css("display")=="none"){$(this).remove()}});
$("#size_table tr td").each(function(){if($(this).css("display")=="none"){$(this).remove()}})}}else{for(g=1;
	g<=row_size;
g++){$("#size_table tr th").each(function(){if($(this).css("display")=="none"){$(this).remove()}});
$("#size_table tr td").each(function(){if($(this).css("display")=="none"){$(this).remove()}})}}}row_size=$("#size_table tr").size();
column_size=$("#size_table tr")[0].cells.length;
if(row_size>1&&column_size>=1){var o="<table class='size_table_head'>",k="<table class='size_table_body'>",l=true,p=false,a=[];
for(var g=1;
	g<=column_size;
g++){o+="<tr><th>"+$("#size_table tr:nth-child(1) th:nth-child("+g+")").text()+"</th></tr>"}if($("#modelInfo").val()!=""){o+="<tr><th>模特信息</th></tr>"}if($("#modelWear").val()!=""){o+="<tr><th>模特穿着</th></tr>"}o+="</table>";
	for(var g=2;
	g<=row_size;
g++){var f=true;
	for(var d=1;
	d<=column_size;
d++){var c=$("#size_table tr:nth-child("+g+") td:nth-child("+d+")").text();
	if(""!=$.trim(c)){f=false}}false==f&&a.push(g)}for(var g=1;
	g<=column_size;
g++){var h="";
for(var d=0,b=a.length-1;
	d<=b;
d++){var c=$("#size_table tr:nth-child("+a[d]+") td:nth-child("+g+")").text();
	if(l){h+="<th>"+c+"</th>"}else{h+="<td>"+c+"</td>"}}if(p){k+="<tr class='size_matters_tr'>"+h+"</tr>"}else{k+="<tr>"+h+"</tr>"}p=!p;
l&&(l=false)}if($("#modelInfo").val()!=""){k+="<tr><td id='modelInfoTd'>"+$("#modelInfo").val()+"</td></tr>"}if($("#modelWear").val()!=""){k+="<tr><td id='modelWearTd'>"+$("#modelWear").val()+"</td></tr>"}k+="</table>";
$(".size_matters_table").html(o+k);
if($("#modelInfo").val()!=""){if($("#modelInfoTd").parent().prev().find("td").css("background-color")=="rgb(255, 255, 255)"){$("#modelInfoTd").css("background-color","rgb(242, 242, 242)")}else{$("#modelInfoTd").css("background-color","rgb(255, 255, 255)")}}if($("#modelWear").val()!=""){if($("#modelWearTd").parent().prev().find("td").css("background-color")=="rgb(255, 255, 255)"){$("#modelWearTd").css("background-color","rgb(242, 242, 242)")}else{$("#modelWearTd").css("background-color","rgb(255, 255, 255)")}}var m=$(".size_table_body th").size();
$("#modelInfoTd").attr("colspan",m);
$("#modelWearTd").attr("colspan",m);
if(1>=m){$(".size_table_body th").attr("width",890);
$(".size_table_body").attr("width",870)}else{if(2==m){$(".size_table_body th").attr("width",445);
$(".size_table_body").attr("width",870)}else{if(3==m){$(".size_table_body th").attr("width",296.6);
$(".size_table_body").attr("width",870)}else{if(4==m){$(".size_table_body th").attr("width",222.5);
$(".size_table_body").attr("width",870)}else{if(5==m){$(".size_table_body th").attr("width",178);
$(".size_table_body").attr("width",870)}else{$(".size_table_body th").attr("width",110);
$(".size_table_body").attr("width",m*110);
$(".size_matters").hScrollPane({mover:".size_table_body",moverW:function(){return $(".size_table_body").width()+100}(),handleCssAlter:"draghandlealter"})}}}}}}}});
var max_shopping=$("#max_shopping").val();
var arrivalproductId=0;
$(function(){var g=$("#product_choose_color_ul li").length;
	var j=$("product_choose_color_ul li a").filter(".border_color2").index();
var e=j+1;
var b=$("#product_choose_size_ul li").length;
var i=$("product_choose_size_ul li a").filter(".border_color2").index();
var k=i+1;
var c=$(".product_details_comments_img span").length;
var f=null;
var d=f+1;
$("#product_choose_color_ul li").click(function(){j=$(this).index();
	e=j+1<g?j+1:0;
if($("#product_choose_color_ul li a").eq(j).find("img").length<2){$("#product_choose_color_ul li a").removeClass("colorselected");
$("#product_choose_color_ul li a").eq(j).addClass("colorselected")}});
$("#product_choose_size_ul li").click(function(r){r.preventDefault();
	i=$(this).index();
var o=$(this).find("a").attr("id");
var q=$(this).find("a").text();
var m=$("#pageforftl").val();
k=i+1<b?i+1:0;
if(!$("#product_choose_size_ul li a").eq(i).hasClass("product_size_none")){$("#product_choose_size_ul li a").removeClass("product_size_Checked");
$("#product_choose_size_ul li a").eq(i).addClass("product_size_Checked");
$("#quantity").val("1");
if(m!="upcomming"){$("#countReduce").attr("class","number_reduce_none");
$("#countAdd").attr("class","number_increase")}$(".maxShoppingCart").each(function(t){if(o==$(this).prev().val()){var u="countAdd('"+$(this).val()+"')";
	max_shopping=$(this).val();
$("#countAdd").attr("onClick",u)}})}if(m==="upcomming"){console.log(m);
	var l=getCheckedProductId();
console.log(l);
isCollecting(l)}if($("#product_choose_size_ul li a").eq(i).hasClass("product_size_maybe")){$("#product_choose_size_ul li .pop_up_box4").show()}var n=$("#product_choose_size_ul li a").eq(i).attr("name");
if(null!=n&&n!=""&&n!="undefined"){var p=$("#product").text();
if(p.indexOf("商品代码 ：",0)>0){p=p.substring(0,p.indexOf("商品代码 ：",0));
$("#product").text(p+" 商品代码 ："+n)}else{$("#product").text(p+" - 商品代码 ："+n)}}var s="glscode="+n+"&size="+q;
goldlogRecord("/mei.6.8","",s,"H1703628")});
$("#bodyDivID").find("#product_color li").live("click",function(){var l=$(this).index();
	var m=l+1<g?l+1:0;
if($("#bodyDivID").find("#product_color li span").eq(l).find("img").length<2){$("#bodyDivID").find("#product_color li span").removeClass("border_color2_Checked").addClass("border_color2");
$("#bodyDivID").find("#product_color li span").eq(l).addClass("border_color2_Checked");
$("#bodyDivID").find("#chosColor").css("visibility","hidden")}chengeCodepic()});
$("#bodyDivID").find("#product_size li").live("click",function(){var m=$(this).index();
	var l=m+1<b?m+1:0;
if($("#bodyDivID").find("#product_size li span").eq(m).attr("class").indexOf("product_size_none")<0){$("#bodyDivID").find("#product_size li span").removeClass("product_size_Checked").addClass("border_color2");
$("#bodyDivID").find("#product_size li span").eq(m).addClass("product_size_Checked");
$("#bodyDivID").find("#chosSize").css("visibility","hidden")}chengeCodepic()});
var a;
$("#product_choose_size_ul >li").hover(function(){i=$(this).index();
	k=i+1<b?i+1:0;
if($("#product_choose_size_ul li a").eq($(this).index()).hasClass("product_size_maybe")){$("#product_choose_size_ul li .pop_up_box4").eq($(this).index()).show()}else{$("#product_choose_size_ul li .pop_up_box3").eq($(this).index()).show()}},function(){i=$(this).index();
	k=i+1<b?i+1:0;
if($("#product_choose_size_ul li a").eq($(this).index()).hasClass("product_size_maybe")){$("#product_choose_size_ul li .pop_up_box4").eq($(this).index()).hide()}else{$("#product_choose_size_ul li .pop_up_box3").eq($(this).index()).hide()}});
var h;
$("#product_choose_size_ul li .pop_up_box4").live("hover",function(){},function(){});
$("#collect_tag_a").live("click",function(){$("#collect_tag_dialog").fadeIn("fast");
	setTimeout(function(){$("#collect_tag_dialog").fadeOut("slow")},1000)});
$(".button_close").live("click",function(){$("#shopping_bag_dialog").fadeOut(600);
	$(".pop_up_shopping_top").fadeOut(600)});
$("#add_shoppingBox_a").live("click",function(){$("#add_shoppingBox_a").html("提交中...");
	var q=null;
var p=$("#eventId").val();
var r=null;
var m=$(".quantity_number input").val();
var l=null;
var o=null;
var n=$("#product_choose_size_ul li a").size();
if(n>0){$("#product_choose_size_ul li a").each(function(){if($(this).attr("class").indexOf("product_size_Checked")>0){q=$(this).attr("id")}})}else{q=$("#hidProdutId").val()}if(q===null||q===""){showdiv("popAddShopbag");
$("#showDivDialog").css("height","auto")}else{$("#chosColor").css("visibility","hidden");
$("#chosSize").css("visibility","hidden");
$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/toAddShopBag",success:function(s){o=s.result;
	if(o!=="login"){showdiv("poplogin")}else{l=addProduct(q,p,r,m)}},error:function(){str_result="fail"}})}if(l!=null){if(l.result==1){$(".quantity_explain").text("")}else{if(l.msg!=""){$(".quantity_explain").text(l.msg);
setTimeout(function(){$(".quantity_explain").text("")},3000)}}}$("#add_shoppingBox_a").html("加入购物袋")});
$("#useful_a").live("click",function(){$("#finish_comment_dialog").show();
	var l=$("#countComment").html();
l++;
$("#countComment").html(l);
setTimeout(function(){$("#finish_comment_dialog").fadeOut("slow")},1000)});
$("#Status_close").live("click",function(){var l=$(this).html();
	if(l=="展开"){$("#shousuo ul").slideDown(300);
$(this).html("收缩");
$(".box_effect_unfold").find("a").addClass("Status_open");
$(".box_effect_unfold").find("a").removeClass("Status_close")}else{$("#shousuo ul").slideUp(300);
$(this).html("展开");
$(".box_effect_unfold").find("a").addClass("Status_close");
$(".box_effect_unfold").find("a").removeClass("Status_open")}});
$("#arrivalAccount1").live("focus",function(){$("#bodyDivID").find("#arrivalAccount1").css("color","black");
	var l=$("#bodyDivID").find("#arrivalAccount1").val();
if(l==="请输入您的手机号码或邮箱"){$("#bodyDivID").find("#arrivalAccount1").val("")}});
jQuery("#icon_play").on("click",function(m){var l=jQuery(this).data("status");
	if(l=="resume"||l=="play"){pauseVideo();
	$(this).addClass("icon_video_play_b");
$(this).removeClass("icon_video_pause_b")}else{if(l=="pause"||l=="end"){resumeVideo();
	$(this).removeClass("icon_video_play_b");
$(this).addClass("icon_video_pause_b")}else{playVideo();
	$(this).removeClass("icon_video_play_b");
$(this).addClass("icon_video_pause_b")}}jQuery(this).addClass("zoomThumbActive")});
$(".tax_explain").on("mouseover",function(){$(".product_tax_popup").show()});
$(".tax_explain").on("mouseout",function(){$(".product_tax_popup").hide()})});
function clickPopImg(d){var a=0;
	var c=$("#showBidDiv");
var b=$("#showDivDialog").offset().left;
a=d.pageX-c.offset().left-c.outerWidth()*2/3;
changeBigPopImgList("showBidImg","","","","popbigleftBtn","popbigrightBtn",20,1,1)}function getVideoID(){if(jQuery("#videoPlayer").find("video").size()>0){return jQuery("#videoPlayer").find("video").attr("id")}if(jQuery("#videoPlayer").find("object").size()>0){return jQuery("#videoPlayer").find("object").attr("id")}}function playVideo(){var a=getVideoID();
	if(jQuery("#videoPlayer").find("video").size()>0){var b=document.getElementById(a);
	b.play()}else{var b=getSWF(a);
	b.start()}jQuery("#icon_play").data("status","play");
jQuery("#icon_play").children("span").addClass("pause")}function resumeVideo(){var a=getVideoID();
	if(jQuery("#videoPlayer").find("video").size()>0){var b=document.getElementById(a);
	b.play()}else{var b=getSWF(a);
	b.resume()}jQuery("#icon_play").data("status","resume");
jQuery("#icon_play").children("span").addClass("pause")}function pauseVideo(){var a=getVideoID();
	if(jQuery("#videoPlayer").find("video").size()>0){var b=document.getElementById(a);
	b.pause()}else{var b=getSWF(a);
	b.pause()}jQuery("#icon_play").data("status","pause");
jQuery("#icon_play").children("span").removeClass("pause")}function getSWF(a){if(window.document[a]){return window.document[a]}else{if(navigator.appName.indexOf("Microsoft")==-1){if(document.embeds[a]){return document.embeds[a]}else{return document[a]}}else{return document.getElementById(a)}}}function scrollDiv(){var k=$(".size_matters");
var h=$(".size_matters_table");
var a=$(".scrollbar2_container");
var e=$(".slider");
var b=h.width();
var c=k.width();
e.width(c*c/b);
var d=e.width();
var i=0;
e.mousedown(function(l){i=l.pageX-$(this).position().left;
	if(this.setCapture){$(this).mousemove(function(m){f(m.pageX-i)});
this.setCapture();
e.mouseup(function(){$(this).unbind("mousemove mouseup");
	this.releaseCapture()})}else{$(document).mousemove(function(m){f(m.pageX-i)});
$(document).mouseup(function(){$(document).unbind("mousemove mouseup")})}return false});
function f(l){if(l<0){l=0}else{if(l>(c-d)){l=c-d}}e.css("left",l);
h.css("left",-(b-c)*l/(c-d))}var g=100;
a.click(function(m){var l=m.pageX-$(this).offset().left;
	if(l>(e.position().left+d)){f(e.position().left+g)}else{if(l<e.position().left){f((e.position().left-g))}}});
e.click(function(l){l.stopPropagation()});
if(a[0].addEventListener){a[0].addEventListener("DOMMouseScroll",j)}a[0].onmousewheel=j;
function j(n){var l=n||window.event;
	var m=l.wheelDelta||l.detail;
if(m==-120||m==3){f(e.position().left+g)}else{if(m==120||m==-3){f(e.position().left-g)}}}}function detailSizeDiv(){var a=$("#menuTop").height();
$("html,body").animate({scrollTop:$(".size_matters_top").offset().top-a},350)}function getOffsetSco(){var b=$("#menuTop .slide_line");
var a=b.width();
return b.offset().left/a}function productTrace(){var a=document.getElementById("productTrace").style.display;
if(a=="none"){$("#productTrace").show();
$("#menuTop .slide_line").animate({marginLeft:0+"px"},"0");
$("#btn_detailShop").addClass("details_nav_Checked")}else{$("#productTrace").hide()}}function showPoPDiv(a){var b=new CustomdDialogPlugin();
	b.showdiv(a)}function showCategoryDiv(){var b=$("#categoryCode").val();
var a=new CustomdDialogPlugin();
if(b=="112"){a.showdiv("dress")}if(b=="114"){a.showdiv("suit")}if(b=="107"||b=="109"||b=="110"||b=="113"||b=="115"||b=="116"||b=="117"){a.showdiv("woman-t-shirt")}if(b=="120"||b=="106"||b=="108"){a.showdiv("garment")}if(b=="101"||b=="102"||b=="124"||b=="125"||b=="127"){a.showdiv("woman-coat")}if(b=="103"||b=="105"||b=="104"){a.showdiv("woman-pants")}if(b=="111"){a.showdiv("skirt")}if(b=="412"||b=="413"||b=="410"||b=="411"){a.showdiv("flattie")}if(b=="407"||b=="408"||b=="409"){a.showdiv("high-heel")}if(b=="118"||b=="119"||b=="121"||b=="123"){a.showdiv("bra")}if(b=="414"){a.showdiv("belt")}if(b=="207"||b=="209"||b=="210"||b=="216"||b=="217"){a.showdiv("man-t-shirt")}if(b=="208"||b=="213"||b=="215"||b=="221"){a.showdiv("top")}if(b=="206"){a.showdiv("shirt")}if(b=="201"||b=="202"||b=="220"){a.showdiv("man-coat")}if(b=="203"||b=="204"||b=="205"){a.showdiv("man-pants")}if(b=="437"||b=="439"||b=="438"||b=="442"||b=="443"||b=="440"||b=="441"){a.showdiv("shoe")}if(b=="451"){a.showdiv("belt")}if(b=="423"||b=="425"||b=="431"||b=="434"||b=="424"||b=="426"){a.showdiv("glass")}if(b=="602"||b=="610"){a.showdiv("earrings")}if(b=="701"||b=="702"||b=="703"||b=="707"||b=="708"||b=="704"||b=="705"||b=="706"){a.showdiv("watch")}if(b=="607"||b=="607"){a.showdiv("ring")}if(b=="601"||b=="609"){a.showdiv("necklace")}if(b=="420"||b=="455"){a.showdiv("hat")}if(b=="417"){a.showdiv("tie")}if(b=="422"||b=="456"){a.showdiv("gloves")}if(b=="401"||b=="402"||b=="403"||b=="405"){a.showdiv("woman")}if(b=="404"){a.showdiv("smallletherbag")}if(b=="445"||b=="448"){a.showdiv("man")}if(b=="444"){a.showdiv("backpack")}goldlogRecord("/mei.6.7","","","H1703627")}function countAdd(a){if($("#countAdd").hasClass("number_increase_none")){return false}var d=null;
var b=$("#product_choose_size_ul li a").size();
if(b>0){$("#product_choose_size_ul li a").each(function(){if($(this).hasClass("product_size_Checked")){d=$(this).attr("id")}});
if(d===null||typeof(d)==="undefined"||d===""){$("#chosSize").css("visibility","visible");
return false}else{$("#chosSize").css("visibility","hidden")}}else{var c=$("#product_choose_color_ul li a").size();
if(c>0){$("#product_choose_color_ul li a").each(function(){if($(this).hasClass("colorselected")){d=$(this).attr("id")}});
if(d===null||typeof(d)==="undefined"||d===""){$("#chosColor").css("visibility","visible");
return false}else{$("#chosColor").css("visibility","hidden")}}else{d=$("#hidProdutId").val()}}var e=$(".quantity_number input").val();
e++;
$("#countReduce").removeClass("number_reduce_none").addClass("number_reduce");
var f=getStock(d);
if(typeof(f)==="undefined"){f=5}if(e>f){if(f===0){$(".quantity_explain").text("非常抱歉，商品已售罄");
setTimeout(function(){$(".quantity_explain").text("")},3000);
return false}else{if(e==(parseInt(a)+1)&&f>a){if(e>=(parseInt(a)+1)){$("#countAdd").addClass("number_increase_none");
$(".quantity_explain").text("您一次最多只能添加"+a+"件商品");
setTimeout(function(){$(".quantity_explain").text("")},3000);
e=a;
$(".quantity_number input").val(e);
return false}else{$(".quantity_explain").text("");
$(".quantity_number input").val(e)}}if(e==f&&f<=a){$(".quantity_number input").val(e);
return false}$(".quantity_explain").text("商品库存不足！");
$("#countAdd").addClass("number_increase_none");
setTimeout(function(){$(".quantity_explain").text("")},3000);
return false}}else{if(e==(parseInt(a)+1)){if(e>=(parseInt(a)+1)){$("#countAdd").addClass("number_increase_none");
$(".quantity_explain").text("您一次最多只能添加"+max_shopping+"件商品");
setTimeout(function(){$(".quantity_explain").text("")},3000);
e=a;
$(".quantity_number input").val(e);
return false}else{$(".quantity_explain").text("");
$(".quantity_number input").val(e)}}else{$(".quantity_number input").val(e)}}}function getStock(a){var b="";
$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/toGetStock",success:function(c){b=c.result+""},error:function(){},data:{productid:a}});
return b}function countReduce(a){if($("#countReduce").hasClass("number_reduce_none")){return false}var b=$(".quantity_number input").val();
$("#countAdd").removeClass("number_increase_none").addClass("number_increase");
b--;
if(b<=a){if(b==a-1){$("#countReduce").addClass("number_reduce_none");
b=a}}$(".quantity_number input").val(b)}function startHtml(){var a=$("#dateStartTime").val();
var c=new Date(a);
var b=parseInt(c/1000/60%60,10);
if(b==0){c.setHours(c.getHours()-1)}$("#startHtml").html($("#startHtml").html()+" <b>活动将于"+(c.getMonth()+1)+"月"+c.getDate()+"日"+c.getHours()+"点开始，您可以将心仪商品加入心愿单</b>")}function eventtimer(){var g=$("#dateTime").val();
var k="活动结束";
var a=false;
var h;
if($("#dateStartTime").size()>0){g=new Date($("#dateStartTime").val());
g.setHours(g.getHours()-1);
k="活动开始";
a=true;
h=g-new Date()}else{var b=$("#startDate").val();
h=(new Date(g))-(new Date());
var f=(new Date(g))-(new Date(b));
var e=parseInt(f/1000/60/60/24,10)}var l=parseInt(h/1000/60/60/24,10);
var c=parseInt(h/1000/60/60%24,10);
var d=parseInt(h/1000/60%60,10);
var m=parseInt(h/1000%60,10);
var j=$("#purchase_type").val();
if(a==false){l=l+1;
	var i=e%7;
if(i==0){i=7}if(l>i){l=(l-i)%7;
	if(l==0){l=7}}else{l=l}l=l-1}if(l<=0&&c<=0&&d<=0&&m<=0){if($.trim($("#spanTimer").text())=="0秒"){if("S-Stock Sales"!=j){$("#countdownStatus").html(k)}}else{if("S-Stock Sales"!=j){$("#countdownStatus").html(k)}}}else{ddd=checkTime(l);
	hhh=checkTime(c);
mmm=checkTime(d);
sss=checkTime(m);
$("#countdownDD").html(32);
$("#countdownHH").html(23);
$("#countdownMM").html(32);
$("#countdownSS").html(32);
setTimeout("eventtimer()",1000)}}function checkTime(a){if(a<10){a="0"+a}return a}function toArrival(c){var a=null;
	var d=null;
var b=null;
var c=null;
if(!checkIsselectSize()){return false}if(!checkIsInputNum()){return false}b=arrivalproductId;
d=$("#bodyDivID").find("#arrivalAccount1").val();
c=$("#eventId").val();
$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/toArrival",success:function(e){a=e.result},data:{productId:b,eventId:c,account:d}});
showPoPDiv("aNSuccess");
return true}function toAddShopBag(){var d=$("#eventId").val();
arrivalproductId=0;
var b=$("#bodyDivID").find(".quantity_number input").val();
var a="";
if(!checkIsselectSize()){return false}var c=arrivalproductId;
$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/toAddShopBag",success:function(f){var e=f.result;
	if(e!=="login"){_closeDialog()}else{a=addProduct(c,d,"",b)}}});
if(a!==""&&a!==null){if(a.result==1){_closeDialog();
	$("#bodyDivID").find(".quantity_explain").text("");
showSmallBags()}else{if(a.msg!=""){$("#bodyDivID").find(".quantity_explain").text(a.msg);
setTimeout(function(){$("#bodyDivID").find(".quantity_explain").text("")},3000)}}}else{showdiv("poplogin")}}function getProductId(){var b=$("#bodyDivID").find("#product_color li").size();
var a=$("#bodyDivID").find("#product_size li").size();
if(b>0&&a===0){$("#bodyDivID").find("#product_color li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}})}else{if(b===0&&a===0){arrivalproductId=$("#hidProdutId").val()}else{if(b>0&&a>0){$("#bodyDivID").find("#product_size li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}})}else{$("#bodyDivID").find("#product_size li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}})}}}}function checkIsselectSize(){var b=$("#bodyDivID").find("#product_color li").size();
var a=$("#bodyDivID").find("#product_size li").size();
if(b>0&&a===0){$("#bodyDivID").find("#product_color li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}});
if(arrivalproductId!==0&&arrivalproductId!==""){$("#bodyDivID").find("#chosSize").css("visibility","hidden");
return true}else{$("#bodyDivID").find("#chosSize").css("visibility","visible");
return false}}else{if(b===0&&a===0){arrivalproductId=$("#hidProdutId").val();
return true}else{if(b>0&&a>0){$("#bodyDivID").find("#product_size li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}});
if(arrivalproductId!==0&&arrivalproductId!==""){$("#bodyDivID").find("#chosSize").css("visibility","hidden");
return true}else{$("#bodyDivID").find("#chosSize").css("visibility","visible");
return false}}else{$("#bodyDivID").find("#product_size li span").each(function(){if($(this).attr("class").indexOf("_Checked")>0){arrivalproductId=$(this).attr("id")}});
if(arrivalproductId!==0&&arrivalproductId!==""){$("#bodyDivID").find("#chosSize").css("visibility","hidden");
return true}else{$("#bodyDivID").find("#chosSize").css("visibility","visible");
return false}}}}}function checkIsInputNum(){var b=$("#bodyDivID").find("#arrivalAccount1").val();
var c=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var d=/^[0-9]{11}$/;
var a;
if(b!==""&&b!==null&&typeof(b)!=="undefined"&&b!="请输入您的手机号码或邮箱"){if(b.indexOf("@")>0){a=c.test(b)}else{a=d.test(b)}if(a){$("#bodyDivID").find("#prompt").text("");
return true}else{$("#bodyDivID").find("#prompt").text("请输入正确的手机号或邮箱");
return false}}else{$("#bodyDivID").find("#prompt").text("请输入您的手机号或邮箱");
return false}}function showProDtSmallBag(b){var a=$(".pop_up_shopping_top");
$(a).fadeIn(500);
var c=$("#contextPath").val();
$.ajax({type:"POST",url:c+"/shoppingBag/smallBag",data:"",success:function(f){var e=getBagHtml(f);
	if(!b){$(".pop_up_shopping_top").html(e);
$(a).fadeIn(500)}var d=$(".my_product").size();
if(d>3){loadScrollSmallBag("my_product_container")}}});
setTimeout(function(){$(a).fadeOut(600)},7000)}function showPopImg(){var a=new popUpPlugin();
	a.popupdiv("divBigImg002");
changeTopImgList("popthumbs","popbigimg","pop_current","pop","popleftBtn","poprightBtn",10,5,1);
changeBigPopImgList("showBidImg","","","","popbigleftBtn","popbigrightBtn",20,1,1)}function popcountReduce(a){var b=$("#bodyDivID").find(".quantity_number input").val();
$("#bodyDivID").find("#countAdd").removeClass("number_increase_none").addClass("number_increase");
b--;
if(b>=a){$("#bodyDivID").find(".quantity_number input").val(b);
if(b==a){$("#bodyDivID").find("#countReduce").addClass("number_reduce_none");
b=a;
return false}}}function popcountAdd(a){if(!checkIsselectSize()){return false}var b=arrivalproductId;
var c=$("#bodyDivID").find(".quantity_number input").val();
c++;
$("#bodyDivID").find("#countReduce").removeClass("number_reduce_none").addClass("number_reduce");
var d=getStock(b);
if(typeof(d)==="undefined"){d=5}if(c>=d){if(d===0){$("#bodyDivID").find(".quantity_explain").text("非常抱歉，商品已售罄");
setTimeout(function(){$("#bodyDivID").find(".quantity_explain").text("")},3000);
return false}else{if((c<=a||c==(parseInt(a)+1))&&d>a){if(c==a||c==(parseInt(a)+1)){$("#bodyDivID").find("#countAdd").addClass("number_increase_none");
$("#bodyDivID").find(".quantity_explain").text("您一次最多只能添加"+a+"件商品");
setTimeout(function(){$("#bodyDivID").find(".quantity_explain").text("")},3000);
c=a;
$("#bodyDivID").find(".quantity_number input").val(c);
return false}else{$("#bodyDivID").find(".quantity_explain").text("");
$("#bodyDivID").find(".quantity_number input").val(c)}}if(c==d&&d<=a){$("#bodyDivID").find(".quantity_number input").val(c);
$("#bodyDivID").find("#countAdd").addClass("number_increase_none");
return false}$("#bodyDivID").find(".quantity_explain").text("商品库存不足！");
setTimeout(function(){$("#bodyDivID").find(".quantity_explain").text("")},3000);
return false}}else{if(c<=a||c==(parseInt(a)+1)){if(c==a||c==(parseInt(a)+1)){$("#bodyDivID").find("#countAdd").addClass("number_increase_none");
$("#bodyDivID").find(".quantity_explain").text("您一次最多只能添加"+max_shopping+"件商品");
setTimeout(function(){$("#bodyDivID").find(".quantity_explain").text("")},3000);
c=a;
$("#bodyDivID").find(".quantity_number input").val(c);
return false}else{$("#bodyDivID").find(".quantity_explain").text("");
$("#bodyDivID").find(".quantity_number input").val(c)}}else{$("#bodyDivID").find(".quantity_number input").val(c)}}}function showArrival(){var a=null;
	$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/isLogin",success:function(c){a=c.result}});
if(a==="login"){showPoPDiv("arrivalNotice");
var b=toGetArrivalInfo();
if(b!==""&&b!==null){$("#bodyDivID").find("#arrivalAccount1").attr("value",b)}chengeCodepic()}else{showdiv("poplogin")}}function showBankArrival(){if($("#membereid").val()==""){showdiv("loginBank")}else{showPoPDiv("arrivalNotice");
var a=toGetArrivalInfo();
if(a!==""&&a!==null){$("#bodyDivID").find("#arrivalAccount1").attr("value",a)}chengeCodepic()}}function toGetArrivalInfo(){var b=$("#contextPath").val();
var a="";
$.ajax({type:"POST",url:b+"/productDetail/toGetArrival",async:false,success:function(c){a=c.result}});
return a}function showSmallBags(b){var a=$(".pop_up_shopping_top");
var c=$("#contextPath").val();
$.ajax({type:"POST",url:c+"/shoppingBag/smallBag",data:"",success:function(f){var e=getBagHtml(f);
	if(!b){$(".pop_up_shopping_top").html(e);
$(a).fadeIn(500)}var d=$(".my_product").size();
if(d>3){loadScrollSmallBag("my_product_container")}}});
setTimeout(function(){$(a).fadeOut(600)},7000)}function chengeCodepic(){getProductId();
	var a=null;
if(arrivalproductId!==null&&arrivalproductId!==""&&arrivalproductId!=="undefined"){$.ajax({type:"post",datatype:"json",async:false,url:loginbaseUrl+"/productDetail/toGetWechatCode",success:function(b){a=b.wechatUrl},error:function(){str_result="fail"},data:{productId:arrivalproductId}});
if(a!=null&&a!==""&&a!=="undefined"){$("#bodyDivID").find(".pop_dhtz_tx_right p img").attr("src","https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="+a)}}}function commentUseful(a){if("nologin"===isLogins()){showdiv("poplogin");
return false}if(a==null||a==""){alert("请选择评论");
return}$.ajax({type:"POST",dataType:"json",url:$("#contextPath").val()+"/comment/saveGoodComment",data:{comment_id:a},cache:false,success:function(c){var b=c.result;
	if(b.code=="0"){$("#goodCount_"+a).text(b.desc);
$("#goodCount_"+a).prev().addClass("liked")}else{$("#_"+a).children(".pop_up_box2").css("display","block");
setTimeout(function(){$("#_"+a).children(".pop_up_box2").css("display","none")},3000)}}})}function GWPSelectClick(d,a,f,c){if(c=="empty"){$("#isEmpty"+d).show()}else{$("#isEmpty"+d).hide()}$("#giftName"+d).html("<a href='"+$(f).attr("name")+"' style='white-space: normal;' >"+$(f).attr("title")+"</a>");
$("#GWPImg"+d).attr("src",a);
$("#GWPImg"+d).attr("title",$(f).attr("title"));
var e=$("#GWPUl"+d+" li span");
for(var b=0;
	b<e.length;
b++){if($("#GWPUl"+d+" li span").eq(b).hasClass("border_color2_Checked")){$("#GWPUl"+d+" li span").eq(b).removeClass("border_color2_Checked");
	$("#GWPUl"+d+" li span").eq(b).addClass("border_color2")}}if($(f).hasClass("border_color2")){$(f).removeClass("border_color2");
$(f).addClass("border_color2_Checked")}}$(function(){$(".p_keyvalue_list li,.keyvalue-short li").each(function(){var a=$(this).children("strong").text();
	if(a.length>12){$(this).children("strong").text(a.substring(0,12)+"...");
$(this).on("mouseover",function(){$(".p_info").hide();
	$(this).children(".p_info").text("").show().text(a)})}});
$(".p_keyvalue_list,.keyvalue-short").on("mouseout","li",function(){$(".p_info").hide()})});
function getCheckedProductId(){var b=null;
	var a=$("#product_choose_size_ul li a").size();
if(a>0){$("#product_choose_size_ul li a").each(function(){if($(this).hasClass("product_size_Checked")){console.log($(this).attr("id"));
	b=$(this).attr("id")}})}else{b=$("#hidProdutId").val()}return b};
